import java.util.Comparator;

public class SortCompare {
    public static Comparator name = new Comparator<Massage>() {
        public int compare(Massage o1, Massage o2) {
            String a = o1.getBookName();
            String b = o2.getBookName();
            return a.compareTo(b);
        }
    };
    public static Comparator author = new Comparator<Massage>() {
        public int compare(Massage o1, Massage o2) {
            String a = o1.getAuthorName();
            String b = o2.getAuthorName();
            return a.compareTo(b);
        }
    };
    public static Comparator id = new Comparator<Massage>() {
        public int compare(Massage o1, Massage o2) {
            int a = o1.getId();
            int b = o2.getId();
            return a - b;
        }
    };
    public static Comparator price = new Comparator<Massage>() {
        public int compare(Massage o1, Massage o2) {
            int a = o1.getPrice();
            int b = o2.getPrice();
            return a - b;
        }
    };
}
